package com.spic.business.alarm.controller;

import com.spic.business.alarm.service.WeatherDataService;
import com.spic.common.core.web.controller.BaseController;
import com.spic.common.core.web.domain.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 水灾告警Controller
 *
 * @author spic
 * @date 2022-03-03
 */
@RestController
@RequestMapping("/weather")
public class WeatherController extends BaseController {

    @Autowired
    private WeatherDataService weatherDataService;

    /**
     * 定时任务新增告警
     */
    @PostMapping("/jobAdd")
    public AjaxResult getNewestOne() {
        return AjaxResult.success(weatherDataService.getNewestOne());
    }
}
